package com.example.day08;

import java.math.BigInteger;

/**
 * 求阶乘
 */
public class BigInterGerDemo {
    public static void main(String[] args) {
        System.out.println(jie(6));
    }

    private static BigInteger jie(int n) {

        if(n==1){
            return  BigInteger.ONE;
        }

        BigInteger b=BigInteger.valueOf(n);

        return  b.multiply(jie(n-1));    //递归调用求阶乘

    }
}
